<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
    
</head>
<body>
    <button>发送get请求</button>
    <button>发送post请求</button>
    <script>
        $('button').eq(0).click(function(){
            // $.get(url,query, fn)
            $.get('http://localhost:8080/query',{username:'atguigu',age:10},function(data){
                console.log(data);
            })
        })

        $('button').eq(1).click(function(){
            $.post('http://localhost:8080/post', {username:'尚硅谷',password:'123123'}, function(data){
                console.log('post res data: ', data);
            })
        })
    </script>
</body>
</html>